<!DOCTYPE html>
<html lang="en-US" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>MySQL函数及用法示例 | 大兵个人主页</title>
    <meta name="description" content="文档">
    <meta name="generator" content="VitePress v1.6.4">
    <link rel="preload stylesheet" href="/assets/style.D9ik_TFu.css" as="style">
    <link rel="preload stylesheet" href="/vp-icons.css" as="style">
    
    <script type="module" src="/assets/app.D5vCjdCn.js"></script>
    <link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
    <link rel="modulepreload" href="/assets/chunks/framework.1mMYEF3_.js">
    <link rel="modulepreload" href="/assets/chunks/theme.DBUxysBs.js">
    <link rel="modulepreload" href="/assets/chunks/katex.BbEIqZs1.js">
    <link rel="modulepreload" href="/assets/chunks/c4Diagram-15b5d702.CrMIheLf.js">
    <link rel="modulepreload" href="/assets/chunks/flowDiagram-cbd28bf7.8p3YBUpp.js">
    <link rel="modulepreload" href="/assets/chunks/flowDiagram-v2-ffc7f31a.DNX3ryn0.js">
    <link rel="modulepreload" href="/assets/chunks/erDiagram-880f2ed8.zLNczVyu.js">
    <link rel="modulepreload" href="/assets/chunks/gitGraphDiagram-21fc4d3e.BpXshfIf.js">
    <link rel="modulepreload" href="/assets/chunks/ganttDiagram-04f9e578.r0eBzhTZ.js">
    <link rel="modulepreload" href="/assets/chunks/infoDiagram-4a4f5b27.BFY8QRU8.js">
    <link rel="modulepreload" href="/assets/chunks/pieDiagram-421022e6.DOknSMVr.js">
    <link rel="modulepreload" href="/assets/chunks/quadrantDiagram-0957ecba.DiST45ax.js">
    <link rel="modulepreload" href="/assets/chunks/xychartDiagram-b6496bcd.xWU8Vg5s.js">
    <link rel="modulepreload" href="/assets/chunks/requirementDiagram-23d650b8.BkUBxLkl.js">
    <link rel="modulepreload" href="/assets/chunks/sequenceDiagram-17ac3bff.Dtk1D-go.js">
    <link rel="modulepreload" href="/assets/chunks/classDiagram-d40c83e7.DSBW7gPl.js">
    <link rel="modulepreload" href="/assets/chunks/classDiagram-v2-d5a6b087.N4cskwQr.js">
    <link rel="modulepreload" href="/assets/chunks/stateDiagram-9c5f0230.CMIV4mhW.js">
    <link rel="modulepreload" href="/assets/chunks/stateDiagram-v2-51a3dcff.D3NEHm_K.js">
    <link rel="modulepreload" href="/assets/chunks/journeyDiagram-29694f62.PhMcaRbo.js">
    <link rel="modulepreload" href="/assets/chunks/flowchart-elk-definition-36e2d292.Bl_kk4ch.js">
    <link rel="modulepreload" href="/assets/chunks/timeline-definition-7e6b55e7.D5qEnHZ_.js">
    <link rel="modulepreload" href="/assets/chunks/mindmap-definition-ac74a2e8.B_Vx45Pe.js">
    <link rel="modulepreload" href="/assets/chunks/sankeyDiagram-23345273.BRDIM71c.js">
    <link rel="modulepreload" href="/assets/chunks/blockDiagram-68f4deed.DFaBUiIv.js">
    <link rel="modulepreload" href="/assets/chunks/virtual_mermaid-config.DDnGl6nM.js">
    <link rel="modulepreload" href="/assets/database_mysql_mysql函数以及用法实例.md.u6ykYWI3.lean.js">
    <link rel="icon" href="/favicon.ico">
    <script>var _hmt=_hmt||[];(function(){var e=document.createElement("script");e.src="https://hm.baidu.com/hm.js?32d81e1cc669a3aef7da8deccdd959ef";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})();</script>
    <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
    <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-5d98c3a5><!--[--><!--]--><!--[--><span tabindex="-1" data-v-0b0ada53></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-0b0ada53>Skip to content</a><!--]--><!----><header class="VPNav" data-v-5d98c3a5 data-v-ae24b3ad><div class="VPNavBar" data-v-ae24b3ad data-v-6aa21345><div class="wrapper" data-v-6aa21345><div class="container" data-v-6aa21345><div class="title" data-v-6aa21345><div class="VPNavBarTitle has-sidebar" data-v-6aa21345 data-v-1168a8e4><a class="title" href="/" data-v-1168a8e4><!--[--><!--]--><!----><span data-v-1168a8e4>大兵个人主页</span><!--[--><!--]--></a></div></div><div class="content" data-v-6aa21345><div class="content-body" data-v-6aa21345><!--[--><!--]--><div class="VPNavBarSearch search" data-v-6aa21345><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-6aa21345 data-v-dc692963><span id="main-nav-aria-label" class="visually-hidden" data-v-dc692963> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>首页</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/ai/" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>AI</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/database/" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>database</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/java/" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>java</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/ops/" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>ops</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/os/" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>os</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/other/" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>other</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/util/" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>util</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://www.500d.me/cvresume/3244698236/" target="_blank" rel="noreferrer" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>关于我</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-dc692963 data-v-cf11d7a2><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-cf11d7a2><span class="text" data-v-cf11d7a2><!----><span data-v-cf11d7a2>其他网站</span><span class="vpi-chevron-down text-icon" data-v-cf11d7a2></span></span></button><div class="menu" data-v-cf11d7a2><div class="VPMenu" data-v-cf11d7a2 data-v-b98bc113><div class="items" data-v-b98bc113><!--[--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-35975db6><a class="VPLink link vp-external-link-icon" href="https://github.com/db117" target="_blank" rel="noreferrer" data-v-35975db6><!--[--><span data-v-35975db6>github</span><!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-35975db6><a class="VPLink link vp-external-link-icon" href="https://leetcode.cn/u/db117/" target="_blank" rel="noreferrer" data-v-35975db6><!--[--><span data-v-35975db6>leetcode</span><!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-b98bc113 data-v-35975db6><a class="VPLink link vp-external-link-icon" href="https://www.processon.com/u/5aaa7a7ee4b0a84684088ded" target="_blank" rel="noreferrer" data-v-35975db6><!--[--><span data-v-35975db6>processon</span><!--]--></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-6aa21345 data-v-6c893767><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-6c893767 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-6aa21345 data-v-0394ad82 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/db117" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-bd121fe5><span class="vpi-social-github"></span></a><a class="VPSocialLink no-icon" href="https://leetcode.cn/u/db117/" aria-label="cool link" target="_blank" rel="noopener" data-v-7bc22406 data-v-bd121fe5><svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="100" height="100" viewBox="0 0 16 16"><path d="M 10.447266 0.265625 A 0.50005 0.50005 0 0 0 10.103516 0.41796875 L 5.65625 4.8671875 L 3.0957031 7.4257812 A 0.50005 0.50005 0 0 0 2.9785156 7.6035156 C 1.769869 8.9739016 1.7865696 11.063913 3.0957031 12.373047 L 5.65625 14.933594 C 7.0176322 16.294976 9.242133 16.294976 10.603516 14.933594 L 12.853516 12.683594 A 0.50063809 0.50063809 0 1 0 12.144531 11.976562 L 9.8945312 14.226562 C 8.9159134 15.20518 7.3418991 15.20518 6.3632812 14.226562 L 3.8027344 11.666016 C 2.8241166 10.687398 2.8241166 9.1114303 3.8027344 8.1328125 L 6.3632812 5.5742188 C 7.3418991 4.5956009 8.9159135 4.5956009 9.8945312 5.5742188 L 12.144531 7.8242188 A 0.50063784 0.50063784 0 1 0 12.853516 7.1171875 L 10.603516 4.8671875 C 9.9106907 4.174363 8.9943718 3.8431189 8.0820312 3.8554688 L 10.8125 1.125 A 0.50005 0.50005 0 0 0 10.447266 0.265625 z M 7.328125 9.4003906 A 0.50005 0.50005 0 1 0 7.328125 10.400391 L 14.228516 10.400391 A 0.50005 0.50005 0 1 0 14.228516 9.4003906 L 7.328125 9.4003906 z"></path></svg></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-6aa21345 data-v-bb2aa2f0 data-v-cf11d7a2><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-cf11d7a2><span class="vpi-more-horizontal icon" data-v-cf11d7a2></span></button><div class="menu" data-v-cf11d7a2><div class="VPMenu" data-v-cf11d7a2 data-v-b98bc113><!----><!--[--><!--[--><!----><div class="group" data-v-bb2aa2f0><div class="item appearance" data-v-bb2aa2f0><p class="label" data-v-bb2aa2f0>Appearance</p><div class="appearance-action" data-v-bb2aa2f0><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-bb2aa2f0 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div></div></div><div class="group" data-v-bb2aa2f0><div class="item social-links" data-v-bb2aa2f0><div class="VPSocialLinks social-links-list" data-v-bb2aa2f0 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/db117" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-bd121fe5><span class="vpi-social-github"></span></a><a class="VPSocialLink no-icon" href="https://leetcode.cn/u/db117/" aria-label="cool link" target="_blank" rel="noopener" data-v-7bc22406 data-v-bd121fe5><svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="100" height="100" viewBox="0 0 16 16"><path d="M 10.447266 0.265625 A 0.50005 0.50005 0 0 0 10.103516 0.41796875 L 5.65625 4.8671875 L 3.0957031 7.4257812 A 0.50005 0.50005 0 0 0 2.9785156 7.6035156 C 1.769869 8.9739016 1.7865696 11.063913 3.0957031 12.373047 L 5.65625 14.933594 C 7.0176322 16.294976 9.242133 16.294976 10.603516 14.933594 L 12.853516 12.683594 A 0.50063809 0.50063809 0 1 0 12.144531 11.976562 L 9.8945312 14.226562 C 8.9159134 15.20518 7.3418991 15.20518 6.3632812 14.226562 L 3.8027344 11.666016 C 2.8241166 10.687398 2.8241166 9.1114303 3.8027344 8.1328125 L 6.3632812 5.5742188 C 7.3418991 4.5956009 8.9159135 4.5956009 9.8945312 5.5742188 L 12.144531 7.8242188 A 0.50063784 0.50063784 0 1 0 12.853516 7.1171875 L 10.603516 4.8671875 C 9.9106907 4.174363 8.9943718 3.8431189 8.0820312 3.8554688 L 10.8125 1.125 A 0.50005 0.50005 0 0 0 10.447266 0.265625 z M 7.328125 9.4003906 A 0.50005 0.50005 0 1 0 7.328125 10.400391 L 14.228516 10.400391 A 0.50005 0.50005 0 1 0 14.228516 9.4003906 L 7.328125 9.4003906 z"></path></svg></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-6aa21345 data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><div class="divider" data-v-6aa21345><div class="divider-line" data-v-6aa21345></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-5d98c3a5 data-v-a6f0e41e><div class="container" data-v-a6f0e41e><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-a6f0e41e><span class="vpi-align-left menu-icon" data-v-a6f0e41e></span><span class="menu-text" data-v-a6f0e41e>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-a6f0e41e data-v-8a42e2b4><button data-v-8a42e2b4>Return to top</button><!----></div></div></div><aside class="VPSidebar" data-v-5d98c3a5 data-v-319d5ca6><div class="curtain" data-v-319d5ca6></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-319d5ca6><span class="visually-hidden" id="sidebar-aria-label" data-v-319d5ca6> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 is-link" data-v-c40bc020 data-v-b3fd67f8><div class="item" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/es/index.html" data-v-b3fd67f8><!--[--><h2 class="text" data-v-b3fd67f8>es</h2><!--]--></a><!----></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/es/search.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>ES 查询操作</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 is-link has-active" data-v-c40bc020 data-v-b3fd67f8><div class="item" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/mysql/index.html" data-v-b3fd67f8><!--[--><h2 class="text" data-v-b3fd67f8>mysql</h2><!--]--></a><!----></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/mysql/Mysql%E6%89%B9%E9%87%8F%E6%8F%92%E5%85%A5%E6%95%B0%E6%8D%AE.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>Mysql批量插入数据</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/mysql/Windows%E8%A7%A3%E5%8E%8B%E5%AE%89%E8%A3%85.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>Windows解压安装</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/mysql/mysql%E5%87%BD%E6%95%B0%E4%BB%A5%E5%8F%8A%E7%94%A8%E6%B3%95%E5%AE%9E%E4%BE%8B.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>MySQL函数及用法示例</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/mysql/mysql%E6%97%B6%E9%97%B4.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>mysql时间.md</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/mysql/window-function.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>窗口函数</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/mysql/%E5%9C%A8%E7%BA%BFyum%E5%AE%89%E8%A3%85.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>在线yum安装</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 is-link" data-v-c40bc020 data-v-b3fd67f8><div class="item" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/oracle/index.html" data-v-b3fd67f8><!--[--><h2 class="text" data-v-b3fd67f8>oracle</h2><!--]--></a><!----></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/oracle/oracle%E8%A1%A8%E7%A9%BA%E9%97%B4.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>ORACLE表空间</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 is-link" data-v-c40bc020 data-v-b3fd67f8><div class="item" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/postgreSql/index.html" data-v-b3fd67f8><!--[--><h2 class="text" data-v-b3fd67f8>postgreSql</h2><!--]--></a><!----></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/postgreSql/analyze.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>sql 分析</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/postgreSql/json.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>json 类型</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/postgreSql/stat.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>一些常用的状态信息</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 is-link" data-v-c40bc020 data-v-b3fd67f8><div class="item" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/redis/index.html" data-v-b3fd67f8><!--[--><h2 class="text" data-v-b3fd67f8>redis</h2><!--]--></a><!----></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/redis/Redisson.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>Redisson</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/redis/Redis%E4%B9%8BUbuntu%E5%AE%89%E8%A3%85.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>Ubuntu安装Redis</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/redis/Scan%20%E8%AF%A6%E7%BB%86.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>scan 解析</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0" data-v-c40bc020 data-v-b3fd67f8><!----><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/sql-exec-seq.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>sql 语句执行顺序</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 is-link" data-v-c40bc020 data-v-b3fd67f8><div class="item" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/sqlserver/index.html" data-v-b3fd67f8><!--[--><h2 class="text" data-v-b3fd67f8>sqlserver</h2><!--]--></a><!----></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/sqlserver/josn.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>json 相关</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/sqlserver/permission.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>权限相关</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/database/sqlserver/systemInfo.html" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>数据库信息获取</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-5d98c3a5 data-v-1428d186><div class="VPDoc has-sidebar has-aside" data-v-1428d186 data-v-39a288b8><!--[--><!--]--><div class="container" data-v-39a288b8><div class="aside" data-v-39a288b8><div class="aside-curtain" data-v-39a288b8></div><div class="aside-container" data-v-39a288b8><div class="aside-content" data-v-39a288b8><div class="VPDocAside" data-v-39a288b8 data-v-3f215769><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-3f215769 data-v-a5bbad30><div class="content" data-v-a5bbad30><div class="outline-marker" data-v-a5bbad30></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-a5bbad30>当前页</div><ul class="VPDocOutlineItem root" data-v-a5bbad30 data-v-b933a997><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-39a288b8><div class="content-container" data-v-39a288b8><!--[--><!--]--><main class="main" data-v-39a288b8><div style="position:relative;" class="vp-doc _database_mysql_mysql%E5%87%BD%E6%95%B0%E4%BB%A5%E5%8F%8A%E7%94%A8%E6%B3%95%E5%AE%9E%E4%BE%8B" data-v-39a288b8><div><h2 id="字符串函数" tabindex="-1">字符串函数 <a class="header-anchor" href="#字符串函数" aria-label="Permalink to &quot;字符串函数&quot;">​</a></h2><ul><li><p>ascii(str)<br> 返回字符串str的第一个字符的ascii值(str是空串时返回0)<br> mysql&gt; select ascii(&#39;2&#39;);<br> 　　-&gt; 50<br> mysql&gt; select ascii(2);<br> 　　-&gt; 50<br> mysql&gt; select ascii(&#39;dete&#39;);<br> 　　-&gt; 100</p></li><li><p>ord(str)<br> 如果字符串str句首是单字节返回与ascii()函数返回的相同值。</p><p>如果是一个多字节字符,以格式返回((first byte ascii code)*256+(second byte ascii code))[*256+third byte asciicode...]<br> mysql&gt; select ord(&#39;2&#39;);<br> 　　 -&gt; 50</p></li><li><p>conv(n,from_base,to_base)<br> 对数字n进制转换,并转换为字串返回(任何参数为null时返回null,进制范围为2-36进制,当to_base是负数时n作为有符号数否则作无符号数,conv以64位点精度工作)<br> mysql&gt; select conv(&quot;a&quot;,16,2);<br> 　　-&gt; &#39;1010&#39; mysql&gt; select conv(&quot;6e&quot;,18,8);<br> 　　-&gt; &#39;172&#39; mysql&gt; select conv(-17,10,-18);<br> 　　-&gt; &#39;-h&#39; mysql&gt; select conv(10+&quot;10&quot;+&#39;10&#39;+0xa,10,10);<br> 　　-&gt; &#39;40&#39;</p></li><li><p>bin(n)<br> 把n转为二进制值并以字串返回(n是bigint数字,等价于conv(n,10,2))<br> mysql&gt; select bin(12);<br> 　　-&gt; &#39;1100&#39;</p></li><li><p>oct(n)<br> 把n转为八进制值并以字串返回(n是bigint数字,等价于conv(n,10,8))<br> mysql&gt; select oct(12);<br> 　　-&gt; &#39;14&#39;</p></li><li><p>hex(n)<br> 把n转为十六进制并以字串返回(n是bigint数字,等价于conv(n,10,16))<br> mysql&gt; select hex(255);<br> 　　-&gt; &#39;ff&#39;</p></li><li><p>char(n,...)<br> 返回由参数n,...对应的ascii代码字符组成的一个字串(参数是n,...是数字序列,null值被跳过)<br> mysql&gt; select char(77,121,83,81,&#39;76&#39;);<br> 　　-&gt; &#39;mysql&#39; mysql&gt; select char(77,77.3,&#39;77.3&#39;);<br> 　　-&gt; &#39;mmm&#39;</p></li><li><p>concat(str1,str2,...)<br> 把参数连成一个长字符串并返回(任何参数是null时返回null)<br> mysql&gt; select concat(&#39;my&#39;, &#39;s&#39;, &#39;ql&#39;);<br> 　　-&gt; &#39;mysql&#39; mysql&gt; select concat(&#39;my&#39;, null, &#39;ql&#39;);<br> 　　-&gt; null mysql&gt; select concat(14.3);<br> 　　-&gt; &#39;14.3&#39;</p></li><li><p>length(str)<br> octet_length(str)<br> char_length(str)<br> character_length(str)<br> 返回字符串str的长度(对于多字节字符char_length仅计算一次) mysql&gt; select length(&#39;text&#39;);<br> 　　-&gt; 4<br> mysql&gt; select octet_length(&#39;text&#39;);<br> 　　-&gt; 4</p></li><li><p>locate(substr,str)<br> position(substr in str)<br> 返回字符串substr在字符串str第一次出现的位置(str不包含substr时返回0)<br> mysql&gt; select locate(&#39;bar&#39;, &#39;foobarbar&#39;);<br> 　　-&gt; 4<br> mysql&gt; select locate(&#39;xbar&#39;, &#39;foobar&#39;);<br> 　　-&gt; 0</p></li><li><p>locate(substr,str,pos)<br> 返回字符串substr在字符串str的第pos个位置起第一次出现的位置(str不包含substr时返回0)<br> mysql&gt; select locate(&#39;bar&#39;, &#39;foobarbar&#39;,5);<br> 　　-&gt; 7</p></li><li><p>instr(str,substr)<br> 返回字符串substr在字符串str第一次出现的位置(str不包含substr时返回0)<br> mysql&gt; select instr(&#39;foobarbar&#39;, &#39;bar&#39;);<br> 　　-&gt; 4<br> mysql&gt; select instr(&#39;xbar&#39;, &#39;foobar&#39;);<br> 　　-&gt; 0</p></li><li><p>lpad(str,len,padstr)<br> 用字符串padstr填补str左端直到字串长度为len并返回<br> mysql&gt; select lpad(&#39;hi&#39;,4,&#39;??&#39;);<br> 　　-&gt; &#39;??hi&#39;</p></li><li><p>rpad(str,len,padstr)<br> 用字符串padstr填补str右端直到字串长度为len并返回<br> mysql&gt; select rpad(&#39;hi&#39;,5,&#39;?&#39;);<br> 　　-&gt; &#39;hi???&#39;</p></li><li><p>left(str,len)<br> 返回字符串str的左端len个字符<br> mysql&gt; select left(&#39;foobarbar&#39;, 5);<br> 　　-&gt; &#39;fooba&#39;</p></li><li><p>right(str,len)<br> 返回字符串str的右端len个字符<br> mysql&gt; select right(&#39;foobarbar&#39;, 4);<br> 　　-&gt; &#39;rbar&#39;</p></li><li><p>substring(str,pos,len)<br> substring(str from pos for len)<br> mid(str,pos,len)<br> 返回字符串str的位置pos起len个字符mysql&gt; select substring(&#39;quadratically&#39;,5,6);<br> 　　-&gt; &#39;ratica&#39;</p></li><li><p>substring(str,pos)<br> substring(str from pos)<br> 返回字符串str的位置pos起的一个子串<br> mysql&gt; select substring(&#39;quadratically&#39;,5);<br> 　　-&gt; &#39;ratically&#39; mysql&gt; select substring(&#39;foobarbar&#39; from 4);<br> 　　-&gt; &#39;barbar&#39;</p></li><li><p>substring_index(str,delim,count)<br> 返回从字符串str的第count个出现的分隔符delim之后的子串 (count为正数时返回左端,否则返回右端子串)<br> mysql&gt; select substring_index(&#39;www.mysql.com&#39;, &#39;.&#39;, 2);<br> 　　-&gt; &#39;www.mysql&#39; mysql&gt; select substring_index(&#39;www.mysql.com&#39;, &#39;.&#39;, -2);<br> 　　-&gt; &#39;mysql.com&#39;</p></li><li><p>ltrim(str)<br> 返回删除了左空格的字符串str<br> mysql&gt; select ltrim(&#39; barbar&#39;);<br> 　　-&gt; &#39;barbar&#39;</p></li><li><p>rtrim(str)<br> 返回删除了右空格的字符串str<br> mysql&gt; select rtrim(&#39;barbar &#39;);<br> 　　-&gt; &#39;barbar&#39;</p></li><li><p>trim([[both | leading | trailing] [remstr] from] str)<br> 返回前缀或后缀remstr被删除了的字符串str(位置参数默认both,remstr默认值为空格)<br> mysql&gt; select trim(&#39; bar &#39;);<br> 　　-&gt; &#39;bar&#39; mysql&gt; select trim(leading &#39;x&#39; from &#39;xxxbarxxx&#39;);<br> 　　-&gt; &#39;barxxx&#39; mysql&gt; select trim(both &#39;x&#39; from &#39;xxxbarxxx&#39;);<br> 　　-&gt; &#39;bar&#39; mysql&gt; select trim(trailing &#39;xyz&#39; from &#39;barxxyz&#39;);<br> 　　-&gt; &#39;barx&#39;</p></li><li><p>soundex(str)<br> 返回str的一个同音字符串(听起来“大致相同”字符串有相同的 同音字符串,非数字字母字符被忽略,在a-z外的字母被当作元音)<br> mysql&gt; select soundex(&#39;hello&#39;);<br> 　　-&gt; &#39;h400&#39; mysql&gt; select soundex(&#39;quadratically&#39;);<br> 　　-&gt; &#39;q36324&#39;</p></li><li><p>space(n)<br> 返回由n个空格字符组成的一个字符串<br> mysql&gt; select space(6);<br> 　　-&gt; &#39; &#39;</p></li><li><p>replace(str,from_str,to_str)<br> 用字符串to_str替换字符串str中的子串from_str并返回<br> mysql&gt; select replace(&#39;www.mysql.com&#39;, &#39;w&#39;, &#39;ww&#39;);<br> 　　-&gt; &#39;wwwwww.mysql.com&#39;</p></li><li><p>repeat(str,count)<br> 返回由count个字符串str连成的一个字符串(任何参数为null时 返回null,count&lt;=0时返回一个空字符串)<br> mysql&gt; select repeat(&#39;mysql&#39;, 3);<br> 　　-&gt; &#39;mysqlmysqlmysql&#39;</p></li><li><p>reverse(str)<br> 颠倒字符串str的字符顺序并返回<br> mysql&gt; select reverse(&#39;abc&#39;);<br> 　　-&gt; &#39;cba&#39;</p></li><li><p>insert(str,pos,len,newstr)<br> 把字符串str由位置pos起len个字符长的子串替换为字符串 newstr并返回<br> mysql&gt; select insert(&#39;quadratic&#39;, 3, 4, &#39;what&#39;);<br> 　　-&gt; &#39;quwhattic&#39;</p></li><li><p>elt(n,str1,str2,str3,...)<br> 返回第n个字符串(n小于1或大于参数个数返回null)<br> mysql&gt; select elt(1, &#39;ej&#39;, &#39;heja&#39;, &#39;hej&#39;, &#39;foo&#39;);<br> 　　-&gt; &#39;ej&#39; mysql&gt; select elt(4, &#39;ej&#39;, &#39;heja&#39;, &#39;hej&#39;, &#39;foo&#39;);<br> 　　-&gt; &#39;foo&#39;</p></li><li><p>field(str,str1,str2,str3,...)<br> 返回str等于其后的第n个字符串的序号(如果str没找到返回0)<br> mysql&gt; select field(&#39;ej&#39;, &#39;hej&#39;, &#39;ej&#39;, &#39;heja&#39;, &#39;hej&#39;, &#39;foo&#39;);<br> 　　-&gt; 2<br> mysql&gt; select field(&#39;fo&#39;, &#39;hej&#39;, &#39;ej&#39;, &#39;heja&#39;, &#39;hej&#39;, &#39;foo&#39;);<br> 　　-&gt; 0</p></li><li><p>find_in_set(str,strlist)<br> 返回str在字符串集strlist中的序号(任何参数是null则返回 null,如果str没找到返回0,参数1包含&quot;,&quot;时工作异常)<br> mysql&gt; select find_in_set(&#39;b&#39;,&#39;a,b,c,d&#39;);<br> 　　-&gt; 2</p></li><li><p>make_set(bits,str1,str2,...)<br> 把参数1的数字转为二进制,假如某个位置的二进制位等于1,对应 位置的字串选入字串集并返回(null串不添加到结果中)<br> mysql&gt; select make_set(1,&#39;a&#39;,&#39;b&#39;,&#39;c&#39;);<br> 　　-&gt; &#39;a&#39; mysql&gt; select make_set(1 | 4,&#39;hello&#39;,&#39;nice&#39;,&#39;world&#39;);<br> 　　-&gt; &#39;hello,world&#39; mysql&gt; select make_set(0,&#39;a&#39;,&#39;b&#39;,&#39;c&#39;);<br> 　　-&gt; &#39;&#39;</p></li><li><p>export_set(bits,on,off,[separator,[number_of_bits]])<br> 按bits排列字符串集,只有当位等于1时插入字串on,否则插入 off(separator默认值&quot;,&quot;,number_of_bits参数使用时长度不足补0 而过长截断)<br> mysql&gt; select export_set(5,&#39;y&#39;,&#39;n&#39;,&#39;,&#39;,4)<br> 　　-&gt; y,n,y,n</p></li><li><p>lcase(str)<br> lower(str)<br> 返回小写的字符串str<br> mysql&gt; select lcase(&#39;quadratically&#39;);<br> 　　-&gt; &#39;quadratically&#39;</p></li><li><p>ucase(str)<br> upper(str)<br> 返回大写的字符串str<br> mysql&gt; select ucase(&#39;quadratically&#39;);<br> 　　-&gt; &#39;quadratically&#39;</p></li><li><p>load_file(file_name)<br> 读入文件并且作为一个字符串返回文件内容(文件无法找到,路径 不完整,没有权限,长度大于max_allowed_packet会返回null)<br> mysql&gt; update table_name set blob_column=load_file (&quot;/tmp/picture&quot;) where id=1;</p></li></ul><h2 id="数学函数" tabindex="-1">数学函数 <a class="header-anchor" href="#数学函数" aria-label="Permalink to &quot;数学函数&quot;">​</a></h2><ul><li><p>abs(n)<br> 返回n的绝对值<br> mysql&gt; select abs(2);<br> 　　-&gt; 2<br> mysql&gt; select abs(-32);<br> 　　-&gt; 32</p></li><li><p>sign(n)<br> 返回参数的符号(为-1、0或1)<br> mysql&gt; select sign(-32);<br> 　　-&gt; -1<br> mysql&gt; select sign(0);<br> 　　-&gt; 0<br> mysql&gt; select sign(234);<br> 　　-&gt; 1</p></li><li><p>mod(n,m)<br> 取模运算,返回n被m除的余数(同%操作符)<br> mysql&gt; select mod(234, 10);<br> 　　-&gt; 4<br> mysql&gt; select 234 % 10;<br> 　　-&gt; 4<br> mysql&gt; select mod(29,9);<br> 　　-&gt; 2</p></li><li><p>floor(n)<br> 返回不大于n的最大整数值<br> mysql&gt; select floor(1.23);<br> 　　-&gt; 1<br> mysql&gt; select floor(-1.23);<br> 　　-&gt; -2</p></li><li><p>ceiling(n)<br> 返回不小于n的最小整数值<br> mysql&gt; select ceiling(1.23);<br> 　　-&gt; 2<br> mysql&gt; select ceiling(-1.23);<br> 　　-&gt; -1</p></li><li><p>round(n,d)<br> 返回n的四舍五入值,保留d位小数(d的默认值为0)<br> mysql&gt; select round(-1.23);<br> 　　-&gt; -1<br> mysql&gt; select round(-1.58);<br> 　　-&gt; -2<br> mysql&gt; select round(1.58);<br> 　　-&gt; 2<br> mysql&gt; select round(1.298, 1);<br> 　　-&gt; 1.3<br> mysql&gt; select round(1.298, 0);<br> 　　-&gt; 1</p></li><li><p>exp(n)<br> 返回值e的n次方(自然对数的底)<br> mysql&gt; select exp(2);<br> 　　-&gt; 7.389056<br> mysql&gt; select exp(-2);<br> 　　-&gt; 0.135335</p></li><li><p>log(n)<br> 返回n的自然对数<br> mysql&gt; select log(2);<br> 　　-&gt; 0.693147<br> mysql&gt; select log(-2);<br> 　　-&gt; null</p></li><li><p>log10(n)<br> 返回n以10为底的对数<br> mysql&gt; select log10(2);<br> 　　-&gt; 0.301030<br> mysql&gt; select log10(100);<br> 　　-&gt; 2.000000<br> mysql&gt; select log10(-100);<br> 　　-&gt; null</p></li><li><p>pow(x,y)<br> power(x,y)<br> 　返回值x的y次幂<br> mysql&gt; select pow(2,2);<br> 　　-&gt; 4.000000<br> mysql&gt; select pow(2,-2);<br> 　　-&gt; 0.250000</p></li><li><p>sqrt(n)<br> 　返回非负数n的平方根<br> mysql&gt; select sqrt(4);<br> 　　-&gt; 2.000000<br> mysql&gt; select sqrt(20);<br> 　　-&gt; 4.472136</p></li><li><p>pi()<br> 　返回圆周率<br> mysql&gt; select pi();<br> 　　-&gt; 3.141593</p></li><li><p>cos(n)<br> 　返回n的余弦值<br> mysql&gt; select cos(pi());<br> 　　-&gt; -1.000000</p></li><li><p>sin(n)<br> 　返回n的正弦值<br> mysql&gt; select sin(pi());<br> 　　-&gt; 0.000000</p></li><li><p>tan(n)<br> 返回n的正切值<br> mysql&gt; select tan(pi()+1);<br> 　　-&gt; 1.557408</p></li><li><p>acos(n)<br> 　返回n反余弦(n是余弦值,在-1到1的范围,否则返回null)<br> mysql&gt; select acos(1);<br> 　　-&gt; 0.000000<br> mysql&gt; select acos(1.0001);<br> 　　-&gt; null<br> mysql&gt; select acos(0);<br> 　　-&gt; 1.570796</p></li><li><p>asin(n)<br> 返回n反正弦值<br> mysql&gt; select asin(0.2);<br> 　　-&gt; 0.201358<br> mysql&gt; select asin(&#39;foo&#39;);<br> 　　-&gt; 0.000000</p></li><li><p>atan(n)<br> 返回n的反正切值<br> mysql&gt; select atan(2);<br> 　　-&gt; 1.107149<br> mysql&gt; select atan(-2);<br> 　　-&gt; -1.107149<br> atan2(x,y)<br> 　返回2个变量x和y的反正切(类似y/x的反正切,符号决定象限)<br> mysql&gt; select atan(-2,2);<br> 　　-&gt; -0.785398<br> mysql&gt; select atan(pi(),0);<br> 　　-&gt; 1.570796</p></li><li><p>cot(n)<br> 返回x的余切<br> mysql&gt; select cot(12);<br> 　　-&gt; -1.57267341<br> mysql&gt; select cot(0);<br> 　　-&gt; null</p></li><li><p>rand()<br> rand(n)<br> 返回在范围0到1.0内的随机浮点值(可以使用数字n作为初始值) mysql&gt; select rand();<br> 　　-&gt; 0.5925<br> mysql&gt; select rand(20);<br> 　　-&gt; 0.1811<br> mysql&gt; select rand(20);<br> 　　-&gt; 0.1811<br> mysql&gt; select rand();<br> 　　-&gt; 0.2079<br> mysql&gt; select rand();<br> 　　-&gt; 0.7888</p></li><li><p>degrees(n)<br> 把n从弧度变换为角度并返回<br> mysql&gt; select degrees(pi());<br> 　　-&gt; 180.000000</p></li><li><p>radians(n)<br> 把n从角度变换为弧度并返回<br> mysql&gt; select radians(90);<br> 　　-&gt; 1.570796</p></li><li><p>truncate(n,d)<br> 保留数字n的d位小数并返回<br> mysql&gt; select truncate(1.223,1);<br> 　　-&gt; 1.2<br> mysql&gt; select truncate(1.999,1);<br> 　　-&gt; 1.9<br> mysql&gt; select truncate(1.999,0);<br> 　　-&gt; 1</p></li><li><p>least(x,y,...)<br> 返回最小值(如果返回值被用在整数(实数或大小敏感字串)上下文或所有参数都是整数(实数或大小敏感字串)则他们作为整数(实数或大小敏感字串)比较,否则按忽略大小写的字符串被比较)<br> mysql&gt; select least(2,0);<br> 　　-&gt; 0<br> mysql&gt; select least(34.0,3.0,5.0,767.0);<br> 　　-&gt; 3.0<br> mysql&gt; select least(&quot;b&quot;,&quot;a&quot;,&quot;c&quot;);<br> 　　-&gt; &quot;a&quot;</p></li><li><p>greatest(x,y,...)<br> 返回最大值(其余同least())<br> mysql&gt; select greatest(2,0);<br> 　　-&gt; 2<br> mysql&gt; select greatest(34.0,3.0,5.0,767.0);<br> 　　-&gt; 767.0<br> mysql&gt; select greatest(&quot;b&quot;,&quot;a&quot;,&quot;c&quot;);<br> 　　-&gt; &quot;c&quot;</p></li></ul><h2 id="时间函数" tabindex="-1">时间函数 <a class="header-anchor" href="#时间函数" aria-label="Permalink to &quot;时间函数&quot;">​</a></h2><ul><li><p>dayofweek(date)<br> 返回日期date是星期几(1=星期天,2=星期一,……7=星期六,odbc标准)<br> mysql&gt; select dayofweek(&#39;1998-02-03&#39;);<br> 　　-&gt; 3</p></li><li><p>weekday(date)<br> 返回日期date是星期几(0=星期一,1=星期二,……6= 星期天)。 mysql&gt; select weekday(&#39;1997-10-04 22:23:00&#39;);<br> 　　-&gt; 5<br> mysql&gt; select weekday(&#39;1997-11-05&#39;);<br> 　　-&gt; 2</p></li><li><p>dayofmonth(date)<br> 返回date是一月中的第几日(在1到31范围内)<br> mysql&gt; select dayofmonth(&#39;1998-02-03&#39;);<br> 　　-&gt; 3</p></li><li><p>dayofyear(date)<br> 返回date是一年中的第几日(在1到366范围内)<br> mysql&gt; select dayofyear(&#39;1998-02-03&#39;);<br> 　　-&gt; 34</p></li><li><p>month(date)<br> 返回date中的月份数值<br> mysql&gt; select month(&#39;1998-02-03&#39;);<br> 　　-&gt; 2</p></li><li><p>dayname(date)<br> 返回date是星期几(按英文名返回)<br> mysql&gt; select dayname(&quot;1998-02-05&quot;);<br> 　　-&gt; &#39;thursday&#39;</p></li><li><p>monthname(date)<br> 返回date是几月(按英文名返回)<br> mysql&gt; select monthname(&quot;1998-02-05&quot;);<br> 　　-&gt; &#39;february&#39;</p></li><li><p>quarter(date)<br> 返回date是一年的第几个季度<br> mysql&gt; select quarter(&#39;98-04-01&#39;);<br> 　　-&gt; 2</p></li><li><p>week(date,first)<br> 返回date是一年的第几周(first默认值0,first取值1表示周一是 周的开始,0从周日开始)<br> mysql&gt; select week(&#39;1998-02-20&#39;);<br> 　　-&gt; 7<br> mysql&gt; select week(&#39;1998-02-20&#39;,0);<br> 　　-&gt; 7<br> mysql&gt; select week(&#39;1998-02-20&#39;,1);<br> 　　-&gt; 8</p></li><li><p>year(date)<br> 返回date的年份(范围在1000到9999)<br> mysql&gt; select year(&#39;98-02-03&#39;);<br> 　　-&gt; 1998</p></li><li><p>hour(time)<br> 返回time的小时数(范围是0到23)<br> mysql&gt; select hour(&#39;10:05:03&#39;);<br> 　　-&gt; 10</p></li><li><p>minute(time)<br> 返回time的分钟数(范围是0到59)<br> mysql&gt; select minute(&#39;98-02-03 10:05:03&#39;);<br> 　　-&gt; 5</p></li><li><p>second(time)<br> 返回time的秒数(范围是0到59)<br> mysql&gt; select second(&#39;10:05:03&#39;);<br> 　　-&gt; 3</p></li><li><p>period_add(p,n)<br> 增加n个月到时期p并返回(p的格式yymm或yyyymm)<br> mysql&gt; select period_add(9801,2);<br> 　　-&gt; 199803</p></li><li><p>period_diff(p1,p2)<br> 返回在时期p1和p2之间月数(p1和p2的格式yymm或yyyymm)<br> mysql&gt; select period_diff(9802,199703);<br> 　　-&gt; 11</p></li><li><p>date_add(date,interval expr type)<br> date_sub(date,interval expr type)<br> adddate(date,interval expr type)<br> subdate(date,interval expr type)<br> 对日期时间进行加减法运算<br> (adddate()和subdate()是date_add()和date_sub()的同义词,也 可以用运算符+和-而不是函数<br> date是一个datetime或date值,expr对date进行加减法的一个表 达式字符串type指明表达式expr应该如何被解释<br> 　[type值 含义 期望的expr格式]:<br> 　second 秒 seconds<br> 　minute 分钟 minutes<br> 　hour 时间 hours<br> 　day 天 days<br> 　month 月 months<br> 　year 年 years<br> 　minute_second 分钟和秒 &quot;minutes:seconds&quot;<br> 　hour_minute 小时和分钟 &quot;hours:minutes&quot;<br> 　day_hour 天和小时 &quot;days hours&quot;<br> 　year_month 年和月 &quot;years-months&quot;<br> 　hour_second 小时, 分钟， &quot;hours:minutes:seconds&quot;<br> 　day_minute 天, 小时, 分钟 &quot;days hours:minutes&quot;<br> 　day_second 天, 小时, 分钟, 秒 &quot;days hours:minutes:seconds&quot; 　expr中允许任何标点做分隔符,如果所有是date值时结果是一个 date值,否则结果是一个datetime值)<br> 　如果type关键词不完整,则mysql从右端取值,day_second因为缺 少小时分钟等于minute_second)<br> 　如果增加month、year_month或year,天数大于结果月份的最大天 数则使用最大天数)<br> mysql&gt; select &quot;1997-12-31 23:59:59&quot; + interval 1 second;<br> 　　-&gt; 1998-01-01 00:00:00<br> mysql&gt; select interval 1 day + &quot;1997-12-31&quot;;<br> 　　-&gt; 1998-01-01<br> mysql&gt; select &quot;1998-01-01&quot; - interval 1 second;<br> 　　-&gt; 1997-12-31 23:59:59<br> mysql&gt; select date_add(&quot;1997-12-31 23:59:59&quot;,interval 1 second);<br> 　　-&gt; 1998-01-01 00:00:00<br> mysql&gt; select date_add(&quot;1997-12-31 23:59:59&quot;,interval 1 day);<br> 　　-&gt; 1998-01-01 23:59:59<br> mysql&gt; select date_add(&quot;1997-12-31 23:59:59&quot;,interval &quot;1:1&quot; minute_second);<br> 　　-&gt; 1998-01-01 00:01:00<br> mysql&gt; select date_sub(&quot;1998-01-01 00:00:00&quot;,interval &quot;1 1:1:1&quot; day_second);<br> 　　-&gt; 1997-12-30 22:58:59<br> mysql&gt; select date_add(&quot;1998-01-01 00:00:00&quot;, interval &quot;-1 10&quot; day_hour);<br> 　　-&gt; 1997-12-30 14:00:00<br> mysql&gt; select date_sub(&quot;1998-01-02&quot;, interval 31 day);<br> 　　-&gt; 1997-12-02<br> mysql&gt; select extract(year from &quot;1999-07-02&quot;);<br> 　　-&gt; 1999<br> mysql&gt; select extract(year_month from &quot;1999-07-02 01:02:03&quot;);<br> 　　-&gt; 199907<br> mysql&gt; select extract(day_minute from &quot;1999-07-02 01:02:03&quot;);<br> 　　-&gt; 20102</p></li><li><p>to_days(date)<br> 返回日期date是西元0年至今多少天(不计算1582年以前)<br> mysql&gt; select to_days(950501);<br> 　　-&gt; 728779<br> mysql&gt; select to_days(&#39;1997-10-07&#39;);<br> 　　-&gt; 729669</p></li><li><p>from_days(n)<br> 给出西元0年至今多少天返回date值(不计算1582年以前)<br> mysql&gt; select from_days(729669);<br> 　　-&gt; &#39;1997-10-07&#39;</p></li><li><p>date_format(date,format)<br> 　根据format字符串格式化date值<br> 　(在format字符串中可用标志符:<br> 　%m 月名字(january……december)<br> 　%w 星期名字(sunday……saturday)<br> 　%d 有英语前缀的月份的日期(1st, 2nd, 3rd, 等等。）<br> 　%y 年, 数字, 4 位<br> 　%y 年, 数字, 2 位<br> 　%a 缩写的星期名字(sun……sat)<br> 　%d 月份中的天数, 数字(00……31)<br> 　%e 月份中的天数, 数字(0……31)<br> 　%m 月, 数字(01……12)<br> 　%c 月, 数字(1……12)<br> 　%b 缩写的月份名字(jan……dec)<br> 　%j 一年中的天数(001……366)<br> 　%h 小时(00……23)<br> 　%k 小时(0……23)<br> 　%h 小时(01……12)<br> 　%i 小时(01……12)<br> 　%l 小时(1……12)<br> 　%i 分钟, 数字(00……59)<br> 　%r 时间,12 小时(hh:mm:ss [ap]m)<br> 　%t 时间,24 小时(hh:mm:ss)<br> 　%s 秒(00……59)<br> 　%s 秒(00……59)<br> 　%p am或pm<br> 　%w 一个星期中的天数(0=sunday ……6=saturday ）<br> 　%u 星期(0……52), 这里星期天是星期的第一天<br> 　%u 星期(0……52), 这里星期一是星期的第一天<br> 　%% 字符% )<br> mysql&gt; select date_format(&#39;1997-10-04 22:23:00&#39;,&#39;%w %m % y&#39;);<br> 　　-&gt; &#39;saturday october 1997&#39;<br> mysql&gt; select date_format(&#39;1997-10-04 22:23:00&#39;,&#39;%h:%i:% s&#39;);<br> 　　-&gt; &#39;22:23:00&#39;<br> mysql&gt; select date_format(&#39;1997-10-04 22:23:00&#39;,&#39;%d %y %a %d %m %b %j&#39;);<br> 　　-&gt; &#39;4th 97 sat 04 10 oct 277&#39;<br> mysql&gt; select date_format(&#39;1997-10-04 22:23:00&#39;,&#39;%h %k %i %r %t %s %w&#39;);<br> 　　-&gt; &#39;22 22 10 10:23:00 pm 22:23:00 00 6&#39;</p></li><li><p>time_format(time,format)<br> 　和date_format()类似,但time_format只处理小时、分钟和秒(其 余符号产生一个null值或0)</p></li><li><p>curdate()<br> current_date()<br> 　以&#39;yyyy-mm-dd&#39;或yyyymmdd格式返回当前日期值(根据返回值所 处上下文是字符串或数字)<br> mysql&gt; select curdate();<br> 　　-&gt; &#39;1997-12-15&#39;<br> mysql&gt; select curdate() + 0;<br> 　　-&gt; 19971215</p></li><li><p>curtime()<br> current_time()<br> 　以&#39;hh:mm:ss&#39;或hhmmss格式返回当前时间值(根据返回值所处上 下文是字符串或数字)<br> mysql&gt; select curtime();<br> 　　-&gt; &#39;23:50:26&#39;<br> mysql&gt; select curtime() + 0;<br> 　　-&gt; 235026</p></li><li><p>now()<br> sysdate()<br> current_timestamp()<br> 　以&#39;yyyy-mm-dd hh:mm:ss&#39;或yyyymmddhhmmss格式返回当前日期 时间(根据返回值所处上下文是字符串或数字)<br> mysql&gt; select now();<br> 　　-&gt; &#39;1997-12-15 23:50:26&#39;<br> mysql&gt; select now() + 0;<br> 　　-&gt; 19971215235026</p></li><li><p>unix_timestamp()<br> unix_timestamp(date)<br> 返回一个unix时间戳(从&#39;1970-01-01 00:00:00&#39;gmt开始的秒 数,date默认值为当前时间)<br> mysql&gt; select unix_timestamp();<br> 　　-&gt; 882226357<br> mysql&gt; select unix_timestamp(&#39;1997-10-04 22:23:00&#39;);<br> 　　-&gt; 875996580</p></li><li><p>from_unixtime(unix_timestamp)<br> 以&#39;yyyy-mm-dd hh:mm:ss&#39;或yyyymmddhhmmss格式返回时间戳的 值(根据返回值所处上下文是字符串或数字)<br> mysql&gt; select from_unixtime(875996580);<br> 　　-&gt; &#39;1997-10-04 22:23:00&#39;<br> mysql&gt; select from_unixtime(875996580) + 0;<br> 　　-&gt; 19971004222300</p></li><li><p>from_unixtime(unix_timestamp,format)<br> 以format字符串格式返回时间戳的值<br> mysql&gt; select from_unixtime(unix_timestamp(),&#39;%y %d %m % h:%i:%s %x&#39;);<br> 　　-&gt; &#39;1997 23rd december 03:43:30 x&#39;</p></li><li><p>sec_to_time(seconds)<br> 以&#39;hh:mm:ss&#39;或hhmmss格式返回秒数转成的time值(根据返回值所处上下文是字符串或数字)<br> mysql&gt; select sec_to_time(2378);<br> 　　-&gt; &#39;00:39:38&#39;<br> mysql&gt; select sec_to_time(2378) + 0;<br> 　　-&gt; 3938</p></li><li><p>time_to_sec(time)<br> 返回time值有多少秒<br> mysql&gt; select time_to_sec(&#39;22:23:00&#39;);<br> 　　-&gt; 80580<br> mysql&gt; select time_to_sec(&#39;00:39:38&#39;);<br> 　　-&gt; 2378</p></li></ul><h2 id="转换函数" tabindex="-1">转换函数 <a class="header-anchor" href="#转换函数" aria-label="Permalink to &quot;转换函数&quot;">​</a></h2><ul><li>cast 用法：cast(字段 as 数据类型) [当然是否可以成功转换，还要看数据类型强制转化时注意的问题] 实例：select cast(a as unsigned) as b from cardserver where order by b desc;</li><li>convert： 用法：convert(字段,数据类型) 实例：select convert(a ,unsigned) as b from cardserver where order by b desc;</li></ul></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><!----><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/database/mysql/Windows%E8%A7%A3%E5%8E%8B%E5%AE%89%E8%A3%85.html" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>上一页</span><span class="title" data-v-e257564d>Windows解压安装</span><!--]--></a></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/database/mysql/mysql%E6%97%B6%E9%97%B4.html" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>下一页</span><span class="title" data-v-e257564d>mysql时间.md</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
    <script>window.__VP_HASH_MAP__=JSON.parse("{\"ai_chatchat.md\":\"C-5I3XwS\",\"ai_index.md\":\"C3uIxAdb\",\"ai_localmodel.md\":\"Tw2gKKoN\",\"ai_milvus.md\":\"DLXVt1og\",\"ai_ollama.md\":\"CFq4_H2q\",\"database_es_index.md\":\"rWZQmRDI\",\"database_es_search.md\":\"DYgkGDUU\",\"database_index.md\":\"CyYsFCeT\",\"database_mysql_index.md\":\"CuJIYihY\",\"database_mysql_mysql函数以及用法实例.md\":\"u6ykYWI3\",\"database_mysql_mysql批量插入数据.md\":\"DaNh4Eq3\",\"database_mysql_mysql时间.md\":\"DWoxXVig\",\"database_mysql_window-function.md\":\"CCyTcTgd\",\"database_mysql_windows解压安装.md\":\"C19Kttnb\",\"database_mysql_在线yum安装.md\":\"BzKPrkQx\",\"database_oracle_index.md\":\"Dsy_5pU2\",\"database_oracle_oracle表空间.md\":\"31gfXSOi\",\"database_postgresql_analyze.md\":\"Do3L-P7v\",\"database_postgresql_index.md\":\"D18KvYua\",\"database_postgresql_json.md\":\"C74fkbrx\",\"database_postgresql_stat.md\":\"DYqZXcQR\",\"database_redis_index.md\":\"BmJZXmFc\",\"database_redis_redisson.md\":\"CTBJAQTZ\",\"database_redis_redis之ubuntu安装.md\":\"DKJRwZvL\",\"database_redis_scan 详细.md\":\"BEi20ISO\",\"database_sql-exec-seq.md\":\"CkOjRd6N\",\"database_sqlserver_index.md\":\"W8H3a0uC\",\"database_sqlserver_josn.md\":\"CrFq1yJX\",\"database_sqlserver_permission.md\":\"BkXCoJXu\",\"database_sqlserver_systeminfo.md\":\"I2FdEH5q\",\"index.md\":\"ASEF8oiq\",\"java_base_collection.md\":\"C0-GOF7g\",\"java_base_jdk source code make.md\":\"C-r-BD4o\",\"java_base_string support switch.md\":\"DVGEg6rs\",\"java_concurrent_abstractqueuedsynchronizer.md\":\"DMlkBcUc\",\"java_concurrent_completablefuture.md\":\"BT5po2Ym\",\"java_concurrent_index.md\":\"CqkzN6-G\",\"java_concurrent_threadpool.md\":\"CnX6VWC_\",\"java_index.md\":\"BuiEFAF_\",\"java_jdk_buffer.md\":\"D1LycCFQ\",\"java_jdk_index.md\":\"7SOTERhX\",\"java_jvm_gc.md\":\"BTVxyeMc\",\"java_jvm_jvm parameter.md\":\"M-GzyFr7\",\"java_jvm_jvm remote.md\":\"Bmc11nec\",\"java_jvm_object.md\":\"Bxnpfi7Z\",\"java_jvm_synchronized.md\":\"ATr4FEqW\",\"java_netty_index.md\":\"C7RtvVyG\",\"java_netty_io.md\":\"x5W13Udu\",\"java_other_bytebuddy.md\":\"Bbx1OFkk\",\"java_other_caffeine.md\":\"ClV1Hv47\",\"java_other_excel import.md\":\"pK5TE-mp\",\"java_other_jackjson.md\":\"BGgjIFYQ\",\"java_other_jetcache.md\":\"zrLJfVLe\",\"java_other_maven.md\":\"DpdnrQUW\",\"java_other_micrometer.md\":\"BL3Guya5\",\"java_other_mybatis.md\":\"DS7HYIqt\",\"java_other_mybatisplus.md\":\"C2_BXMHl\",\"java_other_netty.md\":\"CrA25Xyv\",\"java_other_rocket.md\":\"B0YLJIMO\",\"java_other_shardingsphere.md\":\"CSwRfMTG\",\"java_solve production problems.md\":\"CHd075Nh\",\"java_spring-boot_actuator.md\":\"1XMBMnnM\",\"java_spring-boot_index.md\":\"uWmRRFQ7\",\"java_spring-boot_spring-boot启动流程.md\":\"DefndkWB\",\"java_spring-cloud_context.md\":\"Sh0aX5Er\",\"java_spring-cloud_gateway.md\":\"D4ZtJgkJ\",\"java_spring-cloud_index.md\":\"BvRrZuIT\",\"java_spring-cloud_openfeign.md\":\"CZrmF1w_\",\"java_spring-cloud_sentinel.md\":\"BrIvTgEn\",\"java_spring_error.md\":\"D7WMF0Jq\",\"java_spring_event.md\":\"D1pwiRd1\",\"java_spring_index.md\":\"DXr0PepP\",\"java_spring_jdbctemplate.md\":\"BN4BMHn3\",\"java_spring_spring bean接口.md\":\"B84-mAwF\",\"java_spring_spring ioc.md\":\"CJTn2Uqw\",\"java_spring_spring-aop.md\":\"DeEAdXHF\",\"java_spring_spring-webflux.md\":\"uPqwrWpi\",\"java_spring_springmvc中获取request.md\":\"H1K_4FSo\",\"java_spring_spring扩展接口即执行流程.md\":\"BPOrTZUf\",\"java_spring_流程图合集.md\":\"CyQ-R1Qq\",\"java_util_arthas.md\":\"ClnK4ctf\",\"java_util_dateutil.md\":\"CYCrI78B\",\"java_util_jdk util.md\":\"B792RZpG\",\"java_util_jmh.md\":\"CxRr2Hyq\",\"java_util_reactor.md\":\"CkO8ELFN\",\"ops_docker_easyconnectinit.md\":\"EtSw1aZl\",\"ops_docker_index.md\":\"CZi053V-\",\"ops_docker_zabbix.md\":\"BkbumrUE\",\"ops_docker_常用命令.md\":\"Dtbje96Q\",\"ops_docker_软件安装_docker阿里云镜像安装.md\":\"D2YShg03\",\"ops_docker_软件安装_rpm离线安装docker.md\":\"BHf_DbFJ\",\"ops_docker_软件安装_ubuntu安装docker.md\":\"CsaX5nxD\",\"ops_docker_软件安装_【ubuntu】docker远程连接.md\":\"pOJ3xaE1\",\"ops_elasticsearch_index.md\":\"D6Z69L3S\",\"ops_elasticsearch_query_string.md\":\"cwfTzqZH\",\"ops_filebeat_index.md\":\"xjP1c5Qi\",\"ops_grafana_index.md\":\"CodpIuxh\",\"ops_index.md\":\"D_005h1h\",\"ops_jenkins.md\":\"b9dPY37R\",\"ops_k8s_index.md\":\"DakkcrP8\",\"ops_k8s_kubectl cheatsheet.md\":\"BhEtb5pp\",\"ops_k8s_kubectl.md\":\"DC2xuW6B\",\"ops_logstash_index.md\":\"BvsrlTgd\",\"ops_nginx_index.md\":\"GjqBp5pa\",\"ops_nginx_nginx 性能参数调优.md\":\"UvGtJDRm\",\"ops_nginx_nginx-https.md\":\"C2fK3C0N\",\"ops_nginx_nginx安装.md\":\"4FBodQC9\",\"ops_nginx_nginx配置.md\":\"CyejsGBh\",\"ops_prometheus_alertmanager.md\":\"BiRJnCkQ\",\"ops_prometheus_index.md\":\"BxZzlmzU\",\"ops_prometheus_kube-prometheus.md\":\"ASyuFn0p\",\"ops_prometheus_prometheus-operator.md\":\"DnE-TOYu\",\"ops_prometheus_query.md\":\"blO-hIpo\",\"ops_skywalking_client-config.md\":\"CX-UwEBd\",\"ops_skywalking_index.md\":\"DE1odaSQ\",\"ops_skywalking_server-config.md\":\"CCCE3io1\",\"ops_skywalking_source-code.md\":\"6v5NwXvx\",\"ops_skywalking_ui.md\":\"Dp_9w37w\",\"ops_supervisord.md\":\"DTpRRA6f\",\"os_index.md\":\"CXBRDfQF\",\"os_linux_alpine.md\":\"CqRYorDK\",\"os_linux_index.md\":\"BnkGYxSb\",\"os_linux_ubuntu.md\":\"WYGqbVWu\",\"os_linux_其他命令.md\":\"BwAiH_Vx\",\"os_linux_性能分析.md\":\"Dmglx5Fz\",\"os_linux_文本分析.md\":\"CGiNTcgz\",\"os_mac_dnsmasq.md\":\"C15wfnip\",\"os_mac_homebrew.md\":\"BFFblN8T\",\"os_mac_index.md\":\"4bzv7sFm\",\"os_mac_zsh.md\":\"B-JEkfIE\",\"os_mac_环境搭建.md\":\"PhZggTwP\",\"os_soft.md\":\"B2uWnR7z\",\"os_windows_base64.md\":\"C5ccZkKc\",\"os_windows_index.md\":\"BFTXsHKB\",\"os_windows_winserver.md\":\"3N_Byn25\",\"os_windows_wsl.md\":\"KPfeWY3B\",\"os_windows_乱七八糟.md\":\"C0q7DrKv\",\"os_windows_删除服务.md\":\"CPZ0gSxr\",\"other_algorithm_binarysearch.md\":\"CT6JtL7c\",\"other_algorithm_bit.md\":\"5ou0jP3g\",\"other_algorithm_index.md\":\"BIXkgRmF\",\"other_algorithm_常见算法.md\":\"BTpqAIGh\",\"other_algorithm_排列组合.md\":\"BzjaDp_V\",\"other_chrome.md\":\"xItzPhX3\",\"other_http content-type（内容类型）整理.md\":\"6mxINEE1\",\"other_idea相关.md\":\"KxFpwr7U\",\"other_index.md\":\"B9jR2M7k\",\"other_travis自动持续集成.md\":\"B4beBsFD\",\"other_yaml.md\":\"UzU5GQew\",\"other_乱七八糟_jquery各种操作.md\":\"DfazYd4t\",\"other_乱七八糟_正则表达式.md\":\"B9MooPpT\",\"other_收藏转_二分查找法模板.md\":\"C4sNRviZ\",\"util_excel.md\":\"B5bMkGut\",\"util_freemarker.md\":\"DYIe4gue\",\"util_git_config.md\":\"Drdh5xCZ\",\"util_git_count.md\":\"-PYS7cVV\",\"util_git_fileanalyze.md\":\"BnJK9pYS\",\"util_git_git-operation.md\":\"BvfSXJMo\",\"util_git_git-proxy.md\":\"BFLrkzfX\",\"util_git_index.md\":\"CE0JEsq8\",\"util_git_mergeproject.md\":\"B5ZgkGA2\",\"util_gradle_gradle-task.md\":\"BJF6tasS\",\"util_gradle_index.md\":\"B9mXZers\",\"util_index.md\":\"Bbxv7KHq\",\"util_ip.md\":\"DyAMmrBn\",\"util_openwrt.md\":\"D2WASqbD\",\"util_postman-pre-request.md\":\"Bz9-jQsn\",\"util_ppt.md\":\"CPwcJ90N\",\"util_privoxy.md\":\"BI_TErHz\",\"util_python.md\":\"D_mX_FkF\",\"util_unit-test_index.md\":\"CmBJ9QwN\",\"util_unit-test_junit.md\":\"CohEHvqZ\",\"util_unit-test_mockito.md\":\"CljER1Il\",\"util_wireshark.md\":\"C081jrgd\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"大兵个人主页\",\"description\":\"文档\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"repo\":\"db117/doc\",\"outlineTitle\":\"当前页\",\"editLinks\":true,\"editLinkText\":\"编辑文档！\",\"docsDir\":\"docs\",\"nav\":[{\"text\":\"首页\",\"link\":\"/\"},{\"text\":\"AI\",\"link\":\"/ai/\"},{\"text\":\"database\",\"link\":\"/database/\"},{\"text\":\"java\",\"link\":\"/java/\"},{\"text\":\"ops\",\"link\":\"/ops/\"},{\"text\":\"os\",\"link\":\"/os/\"},{\"text\":\"other\",\"link\":\"/other/\"},{\"text\":\"util\",\"link\":\"/util/\"},{\"text\":\"关于我\",\"link\":\"https://www.500d.me/cvresume/3244698236/\"},{\"text\":\"其他网站\",\"items\":[{\"text\":\"github\",\"link\":\"https://github.com/db117\"},{\"text\":\"leetcode\",\"link\":\"https://leetcode.cn/u/db117/\"},{\"text\":\"processon\",\"link\":\"https://www.processon.com/u/5aaa7a7ee4b0a84684088ded\"}]}],\"sidebar\":{\"/java/\":[{\"text\":\"JDK\",\"items\":[{\"text\":\"JDK 中的 buffer 体系\",\"link\":\"/java/JDK/Buffer\"}],\"link\":\"/java/JDK/index\",\"collapsible\":true},{\"text\":\"JVM\",\"items\":[{\"text\":\"JVM参数\",\"link\":\"/java/JVM/JVM parameter\"},{\"text\":\"垃圾回收\",\"link\":\"/java/JVM/gc\"},{\"text\":\"java开启远程访问\",\"link\":\"/java/JVM/jvm remote\"},{\"text\":\"对象相关\",\"link\":\"/java/JVM/object\"},{\"text\":\"synchronized\",\"link\":\"/java/JVM/synchronized\"}],\"collapsible\":true},{\"text\":\"base\",\"items\":[{\"text\":\"java集合\",\"link\":\"/java/base/collection\"},{\"text\":\"jdk源码编译\",\"link\":\"/java/base/jdk source code make\"},{\"text\":\"string support switch.md\",\"link\":\"/java/base/string support switch\"}],\"collapsible\":true},{\"text\":\"concurrent\",\"items\":[{\"text\":\"AbstractQueuedSynchronizer相关\",\"link\":\"/java/concurrent/AbstractQueuedSynchronizer\"},{\"text\":\"CompletableFuture\",\"link\":\"/java/concurrent/CompletableFuture\"},{\"text\":\"线程池\",\"link\":\"/java/concurrent/ThreadPool\"}],\"link\":\"/java/concurrent/index\",\"collapsible\":true},{\"text\":\"netty\",\"items\":[{\"text\":\"netty 内存模型\",\"link\":\"/java/netty/IO\"}],\"link\":\"/java/netty/index\",\"collapsible\":true},{\"text\":\"other\",\"items\":[{\"text\":\"MyBatis\",\"link\":\"/java/other/MyBatis\"},{\"text\":\"MybatisPlus\",\"link\":\"/java/other/MybatisPlus\"},{\"text\":\"netty 主要流程\",\"link\":\"/java/other/Netty\"},{\"text\":\"byte-buddy 简单使用\",\"link\":\"/java/other/bytebuddy\"},{\"text\":\"caffeine\",\"link\":\"/java/other/caffeine\"},{\"text\":\"大量Excel导入\",\"link\":\"/java/other/excel import\"},{\"text\":\"jackson常见操作\",\"link\":\"/java/other/jackjson\"},{\"text\":\"jetCache\",\"link\":\"/java/other/jetCache\"},{\"text\":\"maven\",\"link\":\"/java/other/maven\"},{\"text\":\"micrometer\",\"link\":\"/java/other/micrometer\"},{\"text\":\"rocketMQ\",\"link\":\"/java/other/rocket\"},{\"text\":\"shardingsphere\",\"link\":\"/java/other/shardingsphere\"}],\"collapsible\":true},{\"text\":\"线上问题分析\",\"link\":\"/java/solve production problems\"},{\"text\":\"spring\",\"items\":[{\"text\":\"JdbcTemplate\",\"link\":\"/java/spring/JdbcTemplate\"},{\"text\":\"spring Bean接口\",\"link\":\"/java/spring/Spring Bean接口\"},{\"text\":\"Spring IOC\",\"link\":\"/java/spring/Spring IOC\"},{\"text\":\"spring-aop\",\"link\":\"/java/spring/Spring-aop\"},{\"text\":\"SpringMVC中获取request\",\"link\":\"/java/spring/SpringMVC中获取request\"},{\"text\":\"Spring扩展接口即执行流程\",\"link\":\"/java/spring/Spring扩展接口即执行流程\"},{\"text\":\"常见异常\",\"link\":\"/java/spring/error\"},{\"text\":\"Spring event\",\"link\":\"/java/spring/event\"},{\"text\":\"spring-webflux\",\"link\":\"/java/spring/spring-webflux\"},{\"text\":\"流程图合集\",\"link\":\"/java/spring/流程图合集\"}],\"link\":\"/java/spring/index\",\"collapsible\":true},{\"text\":\"spring-boot\",\"items\":[{\"text\":\"Spring Boot - Actuator\",\"link\":\"/java/spring-boot/actuator\"},{\"text\":\"spring-boot启动流程\",\"link\":\"/java/spring-boot/spring-boot启动流程\"}],\"link\":\"/java/spring-boot/index\",\"collapsible\":true},{\"text\":\"spring-cloud\",\"items\":[{\"text\":\"spring-cloud-context 详细源码\",\"link\":\"/java/spring-cloud/context\"},{\"text\":\"gateway\",\"link\":\"/java/spring-cloud/gateway\"},{\"text\":\"spring-cloud-openfeign\",\"link\":\"/java/spring-cloud/openfeign\"},{\"text\":\"sentinel\",\"link\":\"/java/spring-cloud/sentinel\"}],\"link\":\"/java/spring-cloud/index\",\"collapsible\":true},{\"text\":\"util\",\"items\":[{\"text\":\"JMH基准测试\",\"link\":\"/java/util/JMH\"},{\"text\":\"arthas 诊断工具\",\"link\":\"/java/util/arthas\"},{\"text\":\"java 时间工具\",\"link\":\"/java/util/dateUtil\"},{\"text\":\"jdk工具\",\"link\":\"/java/util/jdk util\"},{\"text\":\"Reactor\",\"link\":\"/java/util/reactor\"}],\"collapsible\":true}],\"/os/\":[{\"text\":\"linux\",\"items\":[{\"text\":\"Ubuntu相关\",\"link\":\"/os/linux/Ubuntu\"},{\"text\":\"alpine\",\"link\":\"/os/linux/alpine\"},{\"text\":\"其他命令\",\"link\":\"/os/linux/其他命令\"},{\"text\":\"性能分析\",\"link\":\"/os/linux/性能分析\"},{\"text\":\"文本分析\",\"link\":\"/os/linux/文本分析\"}],\"link\":\"/os/linux/index\",\"collapsible\":true},{\"text\":\"mac\",\"items\":[{\"text\":\"Homebrew相关\",\"link\":\"/os/mac/Homebrew\"},{\"text\":\"MAC 下 DNSmasq 安装于使用\",\"link\":\"/os/mac/dnsmasq\"},{\"text\":\"zsh配置\",\"link\":\"/os/mac/zsh\"},{\"text\":\"各种环境\",\"link\":\"/os/mac/环境搭建\"}],\"link\":\"/os/mac/index\",\"collapsible\":true},{\"text\":\"soft.md\",\"link\":\"/os/soft\"},{\"text\":\"windows\",\"items\":[{\"text\":\"base64 操作\",\"link\":\"/os/windows/base64\"},{\"text\":\"制作win服务\",\"link\":\"/os/windows/winServer\"},{\"text\":\"wsl\",\"link\":\"/os/windows/wsl\"},{\"text\":\"乱七八糟\",\"link\":\"/os/windows/乱七八糟\"},{\"text\":\"删除服务.md\",\"link\":\"/os/windows/删除服务\"}],\"link\":\"/os/windows/index\",\"collapsible\":true}],\"/ai/\":[{\"text\":\"chatchat 本地部署\",\"link\":\"/ai/chatchat\"},{\"text\":\"本地运行大模型\",\"link\":\"/ai/localModel\"},{\"text\":\"Milvus 向量数据库\",\"link\":\"/ai/milvus\"},{\"text\":\"ollama 相关\",\"link\":\"/ai/ollama\"}],\"/database/\":[{\"text\":\"es\",\"items\":[{\"text\":\"ES 查询操作\",\"link\":\"/database/es/search\"}],\"link\":\"/database/es/index\",\"collapsible\":true},{\"text\":\"mysql\",\"items\":[{\"text\":\"Mysql批量插入数据\",\"link\":\"/database/mysql/Mysql批量插入数据\"},{\"text\":\"Windows解压安装\",\"link\":\"/database/mysql/Windows解压安装\"},{\"text\":\"MySQL函数及用法示例\",\"link\":\"/database/mysql/mysql函数以及用法实例\"},{\"text\":\"mysql时间.md\",\"link\":\"/database/mysql/mysql时间\"},{\"text\":\"窗口函数\",\"link\":\"/database/mysql/window-function\"},{\"text\":\"在线yum安装\",\"link\":\"/database/mysql/在线yum安装\"}],\"link\":\"/database/mysql/index\",\"collapsible\":true},{\"text\":\"oracle\",\"items\":[{\"text\":\"ORACLE表空间\",\"link\":\"/database/oracle/oracle表空间\"}],\"link\":\"/database/oracle/index\",\"collapsible\":true},{\"text\":\"postgreSql\",\"items\":[{\"text\":\"sql 分析\",\"link\":\"/database/postgreSql/analyze\"},{\"text\":\"json 类型\",\"link\":\"/database/postgreSql/json\"},{\"text\":\"一些常用的状态信息\",\"link\":\"/database/postgreSql/stat\"}],\"link\":\"/database/postgreSql/index\",\"collapsible\":true},{\"text\":\"redis\",\"items\":[{\"text\":\"Redisson\",\"link\":\"/database/redis/Redisson\"},{\"text\":\"Ubuntu安装Redis\",\"link\":\"/database/redis/Redis之Ubuntu安装\"},{\"text\":\"scan 解析\",\"link\":\"/database/redis/Scan 详细\"}],\"link\":\"/database/redis/index\",\"collapsible\":true},{\"text\":\"sql 语句执行顺序\",\"link\":\"/database/sql-exec-seq\"},{\"text\":\"sqlserver\",\"items\":[{\"text\":\"json 相关\",\"link\":\"/database/sqlserver/josn\"},{\"text\":\"权限相关\",\"link\":\"/database/sqlserver/permission\"},{\"text\":\"数据库信息获取\",\"link\":\"/database/sqlserver/systemInfo\"}],\"link\":\"/database/sqlserver/index\",\"collapsible\":true}],\"/ops/\":[{\"text\":\"Jenkins\",\"link\":\"/ops/Jenkins\"},{\"text\":\"docker\",\"items\":[{\"text\":\"深信服easyConnect在docker中进行透明代理\",\"link\":\"/ops/docker/easyconnectInit\"},{\"text\":\"zabbix\",\"link\":\"/ops/docker/zabbix\"},{\"text\":\"常用命令\",\"link\":\"/ops/docker/常用命令\"},{\"text\":\"软件安装\",\"items\":[{\"text\":\"docker阿里云镜像安装\",\"link\":\"/ops/docker/软件安装/docker阿里云镜像安装\"},{\"text\":\"离线安装docker\",\"link\":\"/ops/docker/软件安装/rpm离线安装docker\"},{\"text\":\"ubuntu安装docker\",\"link\":\"/ops/docker/软件安装/ubuntu安装docker\"},{\"text\":\"【Ubuntu】Docker远程连接\",\"link\":\"/ops/docker/软件安装/【Ubuntu】Docker远程连接\"}],\"collapsible\":true}],\"link\":\"/ops/docker/index\",\"collapsible\":true},{\"text\":\"elasticsearch\",\"items\":[{\"text\":\"query_string\",\"link\":\"/ops/elasticsearch/query_string\"}],\"link\":\"/ops/elasticsearch/index\",\"collapsible\":true},{\"text\":\"filebeat\",\"items\":[],\"link\":\"/ops/filebeat/index\",\"collapsible\":true},{\"text\":\"grafana\",\"items\":[],\"link\":\"/ops/grafana/index\",\"collapsible\":true},{\"text\":\"k8s\",\"items\":[{\"text\":\"Kubectl常用\",\"link\":\"/ops/k8s/Kubectl\"},{\"text\":\"kubectl备忘单\",\"link\":\"/ops/k8s/kubectl cheatsheet\"}],\"link\":\"/ops/k8s/index\",\"collapsible\":true},{\"text\":\"logstash\",\"items\":[],\"link\":\"/ops/logstash/index\",\"collapsible\":true},{\"text\":\"nginx\",\"items\":[{\"text\":\"Nginx 性能参数调优.md\",\"link\":\"/ops/nginx/Nginx 性能参数调优\"},{\"text\":\"Nginx安装.md\",\"link\":\"/ops/nginx/Nginx安装\"},{\"text\":\"Nginx配置.md\",\"link\":\"/ops/nginx/Nginx配置\"},{\"text\":\"nginx-https.md\",\"link\":\"/ops/nginx/nginx-https\"}],\"link\":\"/ops/nginx/index\",\"collapsible\":true},{\"text\":\"prometheus\",\"items\":[{\"text\":\"alertmanager\",\"link\":\"/ops/prometheus/alertmanager\"},{\"text\":\"kube-prometheus\",\"link\":\"/ops/prometheus/kube-prometheus\"},{\"text\":\"prometheus-operator\",\"link\":\"/ops/prometheus/prometheus-operator\"},{\"text\":\"查询语法\",\"link\":\"/ops/prometheus/query\"}],\"link\":\"/ops/prometheus/index\",\"collapsible\":true},{\"text\":\"skywalking\",\"items\":[{\"text\":\"客户端配置\",\"link\":\"/ops/skywalking/client-config\"},{\"text\":\"服务配置\",\"link\":\"/ops/skywalking/server-config\"},{\"text\":\"源码分析\",\"link\":\"/ops/skywalking/source-code\"},{\"text\":\"UI详情\",\"link\":\"/ops/skywalking/ui\"}],\"link\":\"/ops/skywalking/index\",\"collapsible\":true},{\"text\":\"supervisord使用\",\"link\":\"/ops/supervisord\"}],\"/other/\":[{\"text\":\"HTTP content-type（内容类型）整理\",\"link\":\"/other/HTTP content-type（内容类型）整理\"},{\"text\":\"Travis自动持续集成\",\"link\":\"/other/Travis自动持续集成\"},{\"text\":\"algorithm\",\"items\":[{\"text\":\"二分算法\",\"link\":\"/other/algorithm/binarySearch\"},{\"text\":\"位运算\",\"link\":\"/other/algorithm/bit\"},{\"text\":\"常见算法\",\"link\":\"/other/algorithm/常见算法\"},{\"text\":\"排列组合\",\"link\":\"/other/algorithm/排列组合\"}],\"link\":\"/other/algorithm/index\",\"collapsible\":true},{\"text\":\"chrome\",\"link\":\"/other/chrome\"},{\"text\":\"idea相关\",\"link\":\"/other/idea相关\"},{\"text\":\"yaml格式\",\"link\":\"/other/yaml\"},{\"text\":\"乱七八糟\",\"items\":[{\"text\":\"jQuery各种操作\",\"link\":\"/other/乱七八糟/jQuery各种操作\"},{\"text\":\"正则\",\"link\":\"/other/乱七八糟/正则表达式\"}],\"collapsible\":true},{\"text\":\"收藏转\",\"items\":[{\"text\":\"二分查找法模板.md\",\"link\":\"/other/收藏转/二分查找法模板\"}],\"collapsible\":true}],\"/util/\":[{\"text\":\"Freemarker\",\"link\":\"/util/Freemarker\"},{\"text\":\"IP 查询\",\"link\":\"/util/IP\"},{\"text\":\"PPT 小技巧\",\"link\":\"/util/PPT\"},{\"text\":\"Excel 公式\",\"link\":\"/util/excel\"},{\"text\":\"git\",\"items\":[{\"text\":\"常见的配置\",\"link\":\"/util/git/config\"},{\"text\":\"git 常用统计\",\"link\":\"/util/git/count\"},{\"text\":\"git 大文件分析\",\"link\":\"/util/git/fileAnalyze\"},{\"text\":\"git命令\",\"link\":\"/util/git/git-operation\"},{\"text\":\"git代理\",\"link\":\"/util/git/git-proxy\"},{\"text\":\"合并多个 git\",\"link\":\"/util/git/mergeProject\"}],\"link\":\"/util/git/index\",\"collapsible\":true},{\"text\":\"gradle\",\"items\":[{\"text\":\"gradle-task\",\"link\":\"/util/gradle/gradle-task\"}],\"link\":\"/util/gradle/index\",\"collapsible\":true},{\"text\":\"openwrt 编译\",\"link\":\"/util/openwrt\"},{\"text\":\"postman预请求处理\",\"link\":\"/util/postman-pre-request\"},{\"text\":\"privoxy\",\"link\":\"/util/privoxy\"},{\"text\":\"python\",\"link\":\"/util/python\"},{\"text\":\"unit-test\",\"items\":[{\"text\":\"JUnit\",\"link\":\"/util/unit-test/JUnit\"},{\"text\":\"mockito\",\"link\":\"/util/unit-test/mockito\"}],\"link\":\"/util/unit-test/index\",\"collapsible\":true},{\"text\":\"wireshark\",\"link\":\"/util/wireshark\"}]},\"lastUpdatedText\":\"上次更新\",\"smoothScroll\":true,\"docFooter\":{\"prev\":\"上一页\",\"next\":\"下一页\"},\"outline\":[2,6],\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/db117\"},{\"icon\":{\"svg\":\"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" x=\\\"0px\\\" y=\\\"0px\\\" width=\\\"100\\\" height=\\\"100\\\" viewBox=\\\"0 0 16 16\\\"><path d=\\\"M 10.447266 0.265625 A 0.50005 0.50005 0 0 0 10.103516 0.41796875 L 5.65625 4.8671875 L 3.0957031 7.4257812 A 0.50005 0.50005 0 0 0 2.9785156 7.6035156 C 1.769869 8.9739016 1.7865696 11.063913 3.0957031 12.373047 L 5.65625 14.933594 C 7.0176322 16.294976 9.242133 16.294976 10.603516 14.933594 L 12.853516 12.683594 A 0.50063809 0.50063809 0 1 0 12.144531 11.976562 L 9.8945312 14.226562 C 8.9159134 15.20518 7.3418991 15.20518 6.3632812 14.226562 L 3.8027344 11.666016 C 2.8241166 10.687398 2.8241166 9.1114303 3.8027344 8.1328125 L 6.3632812 5.5742188 C 7.3418991 4.5956009 8.9159135 4.5956009 9.8945312 5.5742188 L 12.144531 7.8242188 A 0.50063784 0.50063784 0 1 0 12.853516 7.1171875 L 10.603516 4.8671875 C 9.9106907 4.174363 8.9943718 3.8431189 8.0820312 3.8554688 L 10.8125 1.125 A 0.50005 0.50005 0 0 0 10.447266 0.265625 z M 7.328125 9.4003906 A 0.50005 0.50005 0 1 0 7.328125 10.400391 L 14.228516 10.400391 A 0.50005 0.50005 0 1 0 14.228516 9.4003906 L 7.328125 9.4003906 z\\\"></path></svg>\"},\"link\":\"https://leetcode.cn/u/db117/\",\"ariaLabel\":\"cool link\"}],\"search\":{\"provider\":\"local\"}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
    
  </body>
</html>